﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApi001.Domain.Helper
{
    public class JsonHelper
    {
        //序列化
        public static string SerializeObject(object obj)
        {
            //json 串行
            return JsonConvert.SerializeObject(obj, Formatting.Indented,
                new JsonSerializerSettings
                {
                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                    DateFormatString = "yyyy-MM-dd HH-mm-ss"
                });
        }
    }
}
